package cn.jkgly.wxUser.service.impl;


import cn.jkgly.log.entity.SysLog;
import cn.jkgly.log.mapper.SysLogMapper;
import cn.jkgly.wxUser.entity.WxRelateAccount;
import cn.jkgly.wxUser.mapper.WxRelateAccountMapper;
import cn.jkgly.wxUser.service.IWxRelateAccountService;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: 微信关联账户
 * @Author: jeecg-boot
 * @Date:   2020-02-13
 * @Version: V1.0
 */
@Service
public class WxRelateAccountServiceImpl extends ServiceImpl<WxRelateAccountMapper, WxRelateAccount> implements IWxRelateAccountService {
	
	@Autowired
	private WxRelateAccountMapper wxRelateAccountMapper;
	@Autowired
	private SysLogMapper sysLogMapper;
	
	@Override
	public List<WxRelateAccount> selectByMainId(String mainId) {
		return wxRelateAccountMapper.selectByMainId(mainId);
	}

	@Override
	public void addLog(String LogContent, String type,String user) {
		SysLog sysLog = new SysLog();
		//注解上的描述,操作日志内容
		sysLog.setLogContent(LogContent);
		sysLog.setUsername(user);
		sysLog.setRequestType(type);
		try{
			sysLogMapper.insert(sysLog);
		}
		catch (Exception e){
			e.printStackTrace();
		}

	}
}
